package com.whl.sm.vo;

import com.whl.sm.model.repair.RepairApply;
import com.whl.sm.model.repair.RepairTask;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

@Data
@NoArgsConstructor
public class WxRepairApplyTaskVo implements Serializable {

    public WxRepairApplyTaskVo(RepairApply applyData, RepairTask taskData) {
        if (Objects.nonNull(applyData)){
            this.applyId = applyData.getId();
            this.repairType = applyData.getRepairType();
            this.applicant = applyData.getApplicant();
            this.contractTel = applyData.getContractTel();
            this.repairLocation =  applyData.getRepairLocation();
            this.appointmentTime = applyData.getAppointmentTime();
            this.repairDescription = applyData.getRepairDescription();
            this.step = applyData.getStep();
            this.repairStatus = applyData.getRepairStatus();
            this.updateTime = applyData.getUpdateTime();
            this.opinionRemark = applyData.getOpinionRemark();
            this.completeTime = applyData.getCompleteTime();
            this.applicantName = applyData.getApplicantName();
            this.operatorName = applyData.getOperatorName();
            this.repairTypeName = applyData.getRepairTypeName();
            this.applyImgList = applyData.getApplyImgList();
        }
        if (Objects.nonNull(taskData)){
            this.taskId = taskData.getId();
            this.staffId = taskData.getStaffId();
            this.staffName = taskData.getStaffName();
            this.staffTel = taskData.getStaffTel();
            this.repairFeedback = taskData.getRepairFeedback();
            this.source = taskData.getSource();
            this.appraise = taskData.getAppraise();
            this.staffName = taskData.getStaffName();

        }
    }

    private String applyId;

    /**
     * 保修类型
     */
    private String repairType;

    /**
     * 保修者id
     */
    private String applicant;

    /**
     * 联系电话
     */
    private String contractTel;

    /**
     * 保修地点
     */
    private String repairLocation;

    /**
     * 预约时间
     */
    private Date appointmentTime;

    /**
     * 报修内容描述
     */
    private String repairDescription;

    /**
     * 报修状态
     */
    private Integer step;

    /**
     * 报修状态枚举值
     */
    private String repairStatus;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 报修意见:后台人员填写
     */
    private String opinionRemark;

    /**
     * 完成时间
     */
    private Date completeTime;



    /**
     * 申请人姓名
     */
    private String applicantName;

    /**
     * 更新操作者姓名
     */
    private String operatorName;


    /**
     * 报修类型名称
     */
    private String repairTypeName;


    /**
     * 附件图片
     * */
    private List<String> applyImgList;


    private String taskId;

    /**
     * 维修人员id
     */
    private String staffId;

    /**
     * 维修人员联系电话
     */
    private String staffTel;

    /**
     * 维修人员反馈
     */
    private String repairFeedback;

    /**
     * 维修星级评级
     */
    private double source;

    /**
     * 客户回访评价
     */
    private String appraise;



    /**
     * 非数据库字段
     */

    /**
     * 维修人员名称
     */
    private String staffName;


}
